// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import ajax from './libs/ajax.js'
import config from './config/config'
import VueLocalStorage from 'vue-ls'
import Vuex from 'vuex'

Vue.use(Vuex);

//注册vuelocalstorage插件
Vue.use(VueLocalStorage, {
  namespace: 'vuejs__'
});

Vue.config.productionTip = false

Vue.prototype.$ajax = ajax;
Vue.prototype.$axios = axios.create(
    config.axios
);


const store = new Vuex.Store({
  state:{
    appid:0,
    operation:0,
    theme:'',
    identifying:'',
    type:''
  },
  mutations:{
    set_appid(state,appid){
      state.appid = appid
    },
    set_operation(state,operation){
      state.operation = operation
    },
    set_theme(state,theme){
      state.theme = theme
    },
    set_identifying(state,identifying){
      state.identifying = identifying
    },
    set_type(state,type){
      state.type = type
    }
  }
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  'store':store,
  template: '<App/>',
  components: { App }
})
